import 'package:get/get.dart';
import 'package:sabre_sync_fencing/dd_core/dd_user_service.dart';

import '../../../dd_core/dd_config.dart';
import '../../dd_launch_and_main/controllers/dd_main_tab_controller.dart';
import '../pages/dd_home_second_page.dart';

class DDHomeController extends GetxController {

  pushHomeSecond() async {
    Get.find<DDMainTabController>().showMatching.value = true;
    await Future.delayed(Duration(seconds: 3));
    DDRoutesConfig.push(DDHomeSecondPage(), routeName: "/homeSecondPage")?.then(
        (value) =>
            {Get.find<DDMainTabController>().showMatching.value = false});
  }

  @override
  onInit() {
    super.onInit();
    Get.find<DDUserService>().reloadUserCoins();
  }

  @override
  void onClose() {
    super.onClose();
  }
}
